$(function () {
    iFrameResize(null);
});

function iFrameResize(oop) {
    var iFrames = $('iframe');
    function iResize() {
        for (var i = 0, j = iFrames.length;i < j;i++) {
            iFrames[i].style.height = iFrames[i].contentWindow.document.body.offsetHeight + 'px';
        }
    }
    
    if ($.browser.webkit || $.browser.safari || $.browser.opera) {
        iFrames.load(function () {
            setTimeout(iResize, 1);
        });
        for (var i = 0, j = iFrames.length;i < j;i++) {
            var iSource = iFrames[i].src;
            iFrames[i].src = '';
            iFrames[i].src = iSource;
            iFrames[i].scrolling = 'no';
        }
    }
    else {
        if (oop != null) {
            for (var i1 = 0, j1 = iFrames.length;i1 < j1;i1++) {
                if (iFrames[i1].contentWindow.document.body.offsetHeight > 0) {
                    //window.frames[iFrames[i1].id].location.reload();
                    //document.write(iFrames[i1].id + "::::" +iFrames[i1].contentWindow.document.body.innerHTML);
                    alert(iFrames[i1].contentWindow.document.body.offsetHeight);
                    iFrames[i1].offsetParent.style.height = iFrames[i1].contentWindow.document.body.offsetHeight + 14 + 'px';
                    iFrames[i1].style.height = iFrames[i1].contentWindow.document.body.offsetHeight + 'px';
                }
            }
        }
        else {
            iFrames.load(function () {
                alert(this.contentWindow.document.body.offsetHeight);
                this.style.height = this.contentWindow.document.body.offsetHeight + 14 + 'px';
                this.scrolling = 'no';
            });
        }
    }
}